<template>
  <div id="info-container">
    <!--  头部  -->
    <div class="container middle">
      <div class="page-header">
        <div class="page-title">
          <h1>我的债权列表</h1>
          <p style="color:#999999;font-size: 12px"> <span style="color: red;">*</span> 注：审批通过就不能编辑，只能查看详情</p>
        </div>
        <div v-if="!isfromLaywer" class="page-extend">
          <el-button class="publish-btn" type="primary">发布债权</el-button>
        </div>
      </div>
      <div class="page-body">
        <el-table
          :header-cell-style="getRowClass"
          :data="tableData"
          border
          style="width: 100%">
          <el-table-column
            prop="title"
            label="标题"
            align="center">
          </el-table-column>
          <el-table-column
            prop="total"
            label="债权金额"
            align="center"
            width="100">
          </el-table-column>
          <el-table-column
            prop="transfer"
            align="center"
            label="转让金额"
            width="100">
          </el-table-column>
          <el-table-column
            prop="time"
            align="center"
            label="时间">
          </el-table-column>
          <el-table-column
            label="操作"
            align="center"
            width="250">
            <!-- 操作  -->
            <div class="" slot-scope="scope" style="color:#3B8FEE;">
              <span style="margin: 0 15px">编辑</span>
              <span style="margin: 0 15px">删除</span>
              <span style="margin: 0 15px">详情</span>
            </div>
          </el-table-column>
        </el-table>
        <!-- pagination  -->
        <div class="pagination" style="margin-top: 25px">
          <el-pagination
            layout="prev, pager, next"
            :total="50">
          </el-pagination>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "MyCredit",
    props: {
    isfromLaywer: {
      type: Boolean,
      default: false
    }
  },
  data() {
    var data = [];
    for (var i = 0; i< 10; i++) {
      data.push({
        title: '个人转让债权' + i,
        total: '99万',
        transfer: '50万',
        time: '2021-10-23'
      })
    }
    return {
      tableData: data
    }
  },
  methods: {
    getRowClass({rowIndex}) {
      if (rowIndex === 0) {
        return 'background: #3B8FEE;height: 70px;color: #fff;border-color: rgb(59, 143, 238);'
      } else {
        return ''
      }
    }
  }
}
</script>

<style scoped>
  .publish-btn {
    font-size: 20px;
    width: 200px;
    height: 60px;
    background: linear-gradient(41deg, #0083FF 0%, #5EB2FF 100%);
    border-radius: 4px;
  }
</style>
